import { request } from "@/utils/service"
import type * as obj from "./types/news"
import { IdForm, PageForm } from "../common/common"

export function getTableDataApi(data: PageForm) {
  return request<obj.TableList>({
    url: "/mp/news/list",
    method: "get",
    params: data
  })
}

export function getTableInfoApi(data: IdForm) {
  return request<obj.InfoData>({
    url: "/mp/news/info",
    method: "get",
    params: data
  })
}

export function saveTableDataApi(data: obj.CreateOrUpdateTableRequestData) {
  return request<string>({
    url: "/mp/news/save",
    method: "post",
    data
  })
}

export function deleteTableDataApi(data: IdForm) {
  return request<string>({
    url: "/mp/news/delete",
    method: "post",
    data
  })
}
